<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/commons/jsp/taglibs.jsp"%>
<%@taglib uri="http://www.framework.com/taglib" prefix="frame"%>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<style type="text/css">
	li{
		padding-top:8px;
	}
	.st{
	 display:none;
	}
</style>
<form name="addProjectsDataForm" id="addProjectsDataForm" method="post" action="${ctx}/business/projectmanage/bizmanager/doSubmitProjectCode" >
	<input type="hidden" name="id" id="projectIdHidden" value="${project.id}"/>
	<table class="infoTable">
		<tbody>
		<tr>
			<th align="right" width="15%">项目编号</th>
			<td width="35%">
				<input name="code" id="editCode" style="width:180px;" class="easyui-validatebox"  prompt="" data-options="required:true" validType="unique['${ctx }','t_proj_info','code']" value=""/>
			</td>
		</tr>
		</tbody>
	</table>
</form>
<script type="text/javascript">


$(document).ready(function(){ 

	$("#editCode").keydown(function(e){ 
		var curKey = e.which; 
		if(curKey == 13){ 
			if(top.$('#addProjectsDataForm').form('validate')){
				if($("#editCode").val().indexOf(" ")!=-1){
					top.$.messager.alert('提示',"编号不能为空格",'error');
					return;
				}
				
				$.ajax({
					type: "POST",
					timeout:20000,
					url:  "${ctx}/business/projectmanage/bizmanager/doSubmitProjectCode",
					data: top.$('#addProjectsDataForm').serialize(),
					success: function(data){
						if(data =="success"){
							top.$.messager.alert("提示",'修改成功','info',function(){
								//top.$('#listProjectsTable').datagrid('reload');
								 parent.mainAreaFrame.location.reload();
								top.$('#firstLevelDialog').dialog('close');
								//top.$("#uploadify").uploadify('destroy');//销毁文件上传对象....
							});
						}else if(data=="codeexit"){ 
							top.$.messager.alert('提示',"修改失败！编号已存在",'error');
						} else {
							top.$.messager.alert('提示',"修改失败！",'error');
						}
					},
					error: function(res){
						
					}
				});
			}
			return false; 
		} 
	}); 

}); 
		
</script>